Page({
  data: {
    name: '',
    appUrl: 'https://m.duanqu.com?_ariver_appid=3000000048925193&_mp_code=tb&transition=present',
    startTime: '',
    endTime: '',
    appId: '3000000048925193',
    targetEntityList: [],     //投放商品列表 可传入[]
    go2Table:false,
    myCallBack(){},
    myCallBackWithSetData:null, // 使用进行setData的callback
    myBackCallback(){my.navigateTo({ url: '../index/index' })},
    myBackCallbackWithSetData:null,  // 注意this的指向(绑定this)
  },
  onLoad() {

    this.setData({
      name: getApp().name,
      startTime: getApp().startTime,
      endTime: getApp().endTime,
      targetEntityList: getApp().targetEntityList,
    })

    setTimeout(()=>{
      this.cb = this.cb.bind(this);
      this.backCb = this.backCb.bind(this);

      this.setData({
        myCallBackWithSetData: this.cb.bind(this),
        myBackCallbackWithSetData: this.backCb.bind(this)
      })
    },50)
    
  },
  cb() {
    my.alert({content:'fanhui'})
    this.setData({ color: "setdata" })
  },
  backCb() {
    my.alert({content:'fanhui'})
    this.setData({ color: "setdata" })
  },

  getAuth() {//获取用户授权
    my.authorize({
      scopes: '*',
      success: (res) => {
       
      },
      fail: (e) => {
        my.alert({ title: '授权失败', content: JSON.stringify(e) });
      }
    });
  
  },
});
